<template>
	<!--
    	作者：1550495493@qq.com
    	时间：2019-08-13
    	描述：项目管理员-我的桌面
    -->
  <div class="HomePage">
		<!--描述：待办事项-->
		<div class="Website-visits">
			<div class="location">
				<div class="location-text fl">
					<img class="location-img fl" src="../../images/PortalThemes/WebSite.png" />
					<p class="fr">待办事项</p>
				</div>
				<img class="biaotibg fl" src="../../images/home/biaotibg.png" />
				<input @click="openModal()" class="link-btn" type="button" value="更多" />
			</div>
			<div class="Website-visits-nav">
				<table>
					<thead>
						<tr>
							<th>序号</th>
							<th>链接名称</th>
							<th>路径</th>
							<th>操作</th>
						</tr>
					</thead>
					<tbody>
						<tr v-for="(item,index) in friendlyLinkList">
							<td>{{index+1}}</td>
							<td>{{item.name}}</td>
							<td>{{item.url}}</td>
							<td>
								<input class="delete write" type="button" value="修改" @click="openModal(item.id)"/>
								<input class="delete write" type="button" value="删除" @click="deleteData(item.id,1)"/>
							</td>
						</tr>
					</tbody>
				</table>
				<div class="pageination-box">
					<!--total  数据总数   size  一页多少条数据   page  当前页码    changge 返回当前选择的页码  改变一页显示条 child  返回值就是一页显示条数  -->
					<pageination :total="total" :size="size" :page="page" :changge="pageFn" @child="obtainChild"></pageination>
				</div>
			</div>

		</div>
		<!--描述：项目动态-->
		<div class="Operation-records">
			<div class="location">
				<div class="location-text fl">
					<img class="location-img fl" src="../../images/PortalThemes/OperationRecords.png" />
					<p class="fr">项目动态</p>
				</div>
				<img class="biaotibg fl" src="../../images/home/biaotibg.png" />
				<input @click="openModal()" class="link-btn" type="button" value="更多" />
			</div>
			<div class="Operation-records-nav">
				<table>
					<thead>
						<tr>
							<th>序号</th>
							<th>链接名称</th>
							<th>路径</th>
							<th>操作</th>
						</tr>
					</thead>
					<tbody>
						<tr v-for="(item,index) in portalConfigList">
							<td>{{index+1}}</td>
							<td>{{item.name}}</td>
							<td>{{item.url}}</td>
							<td>
								<input @click="isopenModal(item.id)" class="delete write" type="button" value="修改" />
							</td>
						</tr>
					</tbody>
				</table>
				<div class="pageination-box">
					<!--total  数据总数   size  一页多少条数据   page  当前页码    changge 返回当前选择的页码  改变一页显示条 child  返回值就是一页显示条数  -->
					<pageination :total="total" :size="size" :page="page" :changge="pageFn" @child="obtainChild"></pageination>
				</div>
			</div>
		</div>
		<!--模态框--添加新连接-->
		<div v-show="modelShow" class="tenant-model">
			<div class="tenant-model-content ismodel-box">
				<header class="tenant-model-header">
					<h3>{{portalConfig.id == null ? "添加" : "修改"}}连接</h3>
					<span @click="closeModel" class="closeModel">×</span>
				</header>
				<div class="tenant-model-body">
					<div class="search-contain ismodel">
						<!--模态框内容板块-->
						<form id="portalConfigForm" class="form-box">
              <input type="hidden" name="id" :value="portalConfig.id"/>
              <input type="hidden" name="type" value="1"/>
              <div class="form-line input-required">
								<label>链接名称：</label>
								<div class="input-box">
									<input name="name" v-model="portalConfig.name" type="text">
								</div>
							</div>
							<div class="form-line input-required">
								<label>URL：</label>
								<div class="input-box">
									<input name="url" v-model="portalConfig.url" type="text">
								</div>
							</div>
						</form>
					</div>
				</div>
				<footer class="tenant-model-footer">
					<button @click="addlinks" class="determine" v-if="portalConfig.id == null">提交</button>
          <button @click="updateData(1)" class="determine" v-if="portalConfig.id != null">更新</button>
				</footer>
			</div>
		</div>
		<!--模态框--修改-->
		<div v-show="ismodelShow" class="tenant-model">
			<div class="tenant-model-content ">
				<header class="tenant-model-header">
					<h3>修改</h3>
					<span @click="closeModel" class="closeModel">×</span>
				</header>
				<div class="tenant-model-body">
					<div class="search-contain ">
						<form id="portalConfigForm2">
              <!--模态框内容板块-->
              <div class="search-boxs imgbox">
                <input type="hidden" name="id" :value="portalConfig.id"/>
                <a class="Public-btn1 uploadbtn again-upload " @click="touchOffIdInput(1)">重新上传</a>
                <a class="Public-btn1 uploadbtn handIdFrontA " @click="touchOffIdInput(1)">本地上传</a>
                <div class="imgbtn">
                  <input type="file" id="handIdFront" accept="image/*" @change="idFrontImg($event)" style="display: none;" />
                  <img class="showHandIdFront" :src="urls.baseUrl + portalConfig.url"/>
                  <input type="hidden" name="url" :value="portalConfig.url"/>
                </div>
              </div>
            </form>
					</div>
				</div>
				<footer class="tenant-model-footer">
					<button class="cancel">预览</button>
					<button class="determine" @click="updateData(0)">保存</button>
				</footer>
			</div>
		</div>
	</div>
</template>
<script src="./ProjectAdministratorDesktop.js"></script>

<style scoped>
	@import "ProjectAdministratorDesktop.css"
</style>
